package hsmgpslogger.shared;

import java.io.Serializable;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.gwt.maps.client.InfoWindowContent.InfoWindowTab;
import com.google.gwt.maps.client.geom.LatLng;



@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class PositionInfo implements Serializable {
	private static final long serialVersionUID = 1L;
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long id;
	@Persistent
	private Double lat;
	@Persistent
	private Double lon;
	@Persistent
	private Double alt;
	
	public PositionInfo(
	){}
	
	public void setId(Long newId) {
		id = newId;
	}
	
	public Long getId() {
		return id;
	}

	public void setLat(Double lat) {
		this.lat = lat;
	}

	public Double getLat() {
		return lat;
	}

	public void setLon(Double lon) {
		this.lon = lon;
	}

	public Double getLon() {
		return lon;
	}

	public void setAlt(Double alt) {
		this.alt = alt;
	}

	public Double getAlt() {
		return alt;
	}
	
	@Override
	public String toString(){
		return "Position is: Lat:"+lat + " Lon:" +lon + " Alt:" + alt;
	}
	
	public LatLng getLatLng(){
		LatLng ll = LatLng.newInstance(getLat(), getLon());
		return ll;
	}

	public String toHTML() {
		// TODO Auto-generated method stub
		return null;
	}
}
